<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="./css/element.css">
</head>
<body>
<div id="app">
    <el-table
            :data="tableData"
            border
            style="width: 60%">
        <el-table-column
                prop="id"
                label="ID"
                width="180">
        </el-table-column>
        <el-table-column
                prop="name"
                label="姓名"
                width="180">
        </el-table-column>
        <el-table-column
                prop="age"
                label="年龄">
        </el-table-column>
        <el-table-column
                prop="email"
                label="邮箱">
        </el-table-column>
        <el-table-column
                prop="status"
                label="状态">
        </el-table-column>
    </el-table>
</div>
<script src="./js/vue.js"></script>
<script src="./js/element.js"></script>
<script src="./js/axios.min.js"></script>
<script>
    //设置axios发送请求的目标地址
    axios.default.baseURI="http://localhost:8082/";
    let app = new Vue({
        el:"#app",
        data:{
            tableData: [

            ]
        },
        methods:{

        },
        //解析模板前的生命周期钩子
        created(){
            axios.get("/student/findAll")
            .then(
                resp => {
                    console.log(resp);
                    this.tableData=resp.data;
                    console.log(resp.data)
                    console.log(this.tableData)
                }
            )
            .catch(
                err =>{
                    console.log(err);
                    this.tableData=[]
                }
            );

        }
    })
</script>
</body>
</html>